import scala.swing.TabbedPane

package layoutVariety
{
	class TabPanel(ref : Int) extends Widget(ref) 
	{
	  val pane = new TabbedPane
	  jc = pane
	  
	  // adds a new tab
	  def addTab(title: String, content : Widget)
	  {
	    val tab = new TabbedPane.Page(title,content.getWidget)
	    pane.pages.append(tab)
	  }
	  	  
	  // index starts at zero
	  def removeTab(index : Int)
	  {
	    pane.pages.remove(index)	    
	  }
	  
	  // returns the index of the current tab
	  def currentSelectionIndex() : Int = pane.selection.index
	}
}